package com.sdweizan.sdk.bytedance.util;

import com.sdweizan.sdk.bytedance.error.BdErrorException;

import java.io.IOException;

public abstract class SimpleRequestExecutor<T, E> implements RequestExecutor<T, E> {

  @Override
  public void execute(String requestUri, E requestBody, ResponseHandler<T> handler)
      throws BdErrorException, IOException {
    handler.handle(execute(requestUri, requestBody));
  }

  protected String handleResponse(String responseContent)
      throws BdErrorException, IOException {
    return responseContent;
  }
}
